package chapter8;

import java.util.ArrayList;
import java.util.List;

public class ListTest {
    public static void main(String[] args) {
        List languages = new ArrayList();
        languages.add("Java");
        languages.add("python");
        languages.add("nodejs");
        System.out.println(languages);
        languages.add(1, "go");
        for (int i = 0; i < languages.size(); i++) {
            System.out.println(languages.get(i));
        }
        languages.remove(2);
        System.out.println(languages.indexOf("Java"));
        languages.set(1, "go");
        System.out.println(languages);
        System.out.println(languages.subList(1, 2));
    }
}
